@import "../abstracts/colors.less";

.page-header {
    display: block;
    display: flex;
    align-items: center;
    height: 3.5rem;

    font-family: Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;

    background-color: @header-bg-classic;
}

.page-header > * {
    margin-right: 0.75rem;
}

.page-header__brand {
    display: inline-block;
    height: 100%;
    position: relative;
    flex: 1; // push controls to the end of the block
}

// Need to use the element selector to increase weight otherwise it will be overriden by the
// a:visited selector if it is declared later
// Only styled by the overrides with the new UI enabled
a.page-header__brand-link {
    display: none;
}

.page-header__brand-name {
    color: inherit;
}

.page-header__brand-image {
    height: 32px;
    width: 24px;
    height: 2rem;
    width: 1.5rem;
    margin-right: 0.75rem;
}

.page-header__am-wrapper {
    height: 100%;
    padding: 0.5rem 0;
}

.page-header__hyperlinks {
    display: flex;
    align-items: center;
}

.page-header__hyperlinks A {
    display: inline-block;
    display: inline-flex;
    align-items: center;

    // need to override an existing rule
    padding-right: 0.5rem;
    padding: 0.5rem;
    margin-right: 0.25rem;
    font-weight: bold;

    outline-color: @header-link-outline;

    &:link,
    &:visited {
        color: @header-link-color;
        border-radius: @header-item-border-radius;
        text-decoration: none;
    }

    &:hover,
    &:focus,
    &.mouseIsOverMenuSelector {
        color: @header-link-color-active;
        background-color: @header-link-bg-classic-hover;
        text-decoration: underline;
        text-decoration-color: @header-link-color-active;
    }

    &:active {
        background-color: @header-link-bg-classic-active;
    }
}

// This could probably be colocated with the rest of the AM CSS,
// But we put it here to take advantage of the variables
#visible-am-container.visible #visible-am-button {
    background-color: @header-link-bg-classic-active;
    text-decoration: none;
}

.page-header__hyperlinks a span {
    font-weight: bold;

    &:not(:first-child) {
        margin-left: 0.25rem;
    }
}

/* Search box */

// Style it through the id selector to override the YUI selectors set by
// the YUI Autocomplete module
#searchform {
    position: relative;
    font-family: Roboto, Helvetica, Arial, sans-serif;
    display: inline-block;
    display: inline-flex;
    height: 2.5rem;
}

// Need to add the id selector to override the ".yui-skin-sam .yui-ac-input" set by
// the YUI Autocomplete module
#search-box.main-search__input {
    position: static;
    padding: 0.25rem 2.5rem;
    margin: 0;

    font-size: 1rem;
    line-height: 1.5;
    font-weight: bold;
    color: @search-input-color;
    font-family: Roboto, Helvetica, Arial, sans-serif;

    border-radius: @header-item-border-radius;
    border: 3px solid white;
    outline: none;

    &::placeholder {
        font-weight: normal;
    }

    &:focus {
        border-color: @header-link-outline;
    }
}

.main-search__icon-leading,
.main-search__icon-trailing {
    position: absolute;
    display: inline-block;
    display: inline-flex;
    height: 2.5rem;
    width: 2.5rem;
    padding: 0.5rem;
    justify-content: center;
    align-items: center;
    background: transparent;
}

.main-search__icon-leading {
    left: 0;
    pointer-events: none;
}

.main-search__icon-trailing {
    right: 0;
    outline-color: @header-link-outline;

    &:link,
    &:visited {
        color: @search-input-color;
    }

    &:hover,
    &:focus {
        color: @header-link-bg-classic-hover;
    }

    &:active {
        fill: @header-link-bg-classic-active;
    }
}

#search-box-completion {
    text-align: left;
    width: 25em;
    position: absolute;
    z-index: 1000;
}

#search-box-completion .yui-ac-content {
    width: 30em;
    background-color: @search-background;
    overflow: hidden;

    // TODO:  chose a better box shadow
    box-shadow: @search-box-shadow;

    border: none;
    border-radius: @header-item-border-radius;
}

#search-box-completion UL {
    padding: 0.75rem 0;
    width: 100%;
    margin: 0 0;
    list-style: none;
}

#search-box-completion LI {
    white-space:nowrap;

    padding: 0.25rem 1.25rem;
    font-size: 1rem;
    line-height: 1.5;
}

#search-box-completion LI.yui-ac-highlight {
    background: @search-box-completion-bg;
    font-weight: bold;
}

#search-box-minWidth {
    position:absolute;
    visibility: hidden;
    width:15rem;
}

#search-box-sizer {
    position:absolute;
    visibility: hidden;
}
